package com.taritari.journal.controller;

import com.taritari.journal.entity.po.BrowseLog;
import com.taritari.journal.services.BrowseLogService;
import com.taritari.journal.utils.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author taritari
 * @date 2024-04-19 17:49
 * @description 浏览记录表
 */
@RestController
@Slf4j
@Tag(name = "浏览记录接口", description = "浏览记录接口")
@RequestMapping("/browsed")
public class BrowseLogController {
    @Autowired
    private BrowseLogService browseLogService;

    @PostMapping ("/add")
    @Operation(summary = "添加树洞浏览日志", description = "添加树洞浏览日志")
    public Result add(@RequestBody BrowseLog browseLog) {
        int i = browseLogService.insertBrowseLog(browseLog);
        return Result.success(i);
    }
}
